package edu.jd.movieplatform.admin.a_cinema.impl;

import edu.jd.movieplatform.admin.a_cinema.a_CinemaDto;
import edu.jd.movieplatform.admin.a_cinema.a_CinemaService;
import edu.jd.movieplatform.admin.a_cinema.dao.a_CinemaDao;
import edu.jd.movieplatform.common.Utils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.Map;

@Service //受Spring管理的业务组件（Bean）
@Transactional//本类的事务性
public class a_CinemaServiceImpl implements a_CinemaService {

    @Resource
    private a_CinemaDao a_cinemaDao;

    @Override
    public Map<String, Object> geta_CinemaList(a_CinemaDto dto){
        return Utils.getPage(dto, ()-> a_cinemaDao.finda_CinemaList(dto));
    }

    @Override
    public void addCinema(a_CinemaDto dto) {
        a_cinemaDao.insertCinema(dto);
    }

    @Override
    public void deleteCinema(Integer id) {
        a_cinemaDao.deleteCinema(id);
    }

    @Override
    public void updCinema(a_CinemaDto dto) {
        a_cinemaDao.updateCinema(dto);
    }
}
